home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_03
/
9n03105a
< prev
next >
Wrap
Text File
|
1991-01-14
|
984b
|
45 lines
/* memtest.c --- test bed program for checking some
huge arrays */
/* ...use COMPACT memory model */
#include <stdio.h>
#include <alloc.h>
char (huge *pinno)[20][8]; /* each term can have up
to 20 pins */
void main(void)
{
int i, j, k;
if ( (pinno=farcalloc(sizeof(*pinno),1000)) ==NULL)
{
printf("\nallocation error");
printf("...insufficient memory available...\n");
exit(1);
}
printf("\narray of 160000 characters starts at %p \
(norm)\n",pinno);
printf("\narray at %Fp (far)\n",pinno);
for (i = 0; i < 1000; i++)
{
for (j = 0; j < 20; j++)
{
for (k = 0; k < 7; k++)
pinno[i][j][k]=0x41+k+j;
pinno[i][j][k]='\0';
}
}
for (i = 0; i < 1000; i++)
{
for (j = 0; j < 20; j++)
printf("\narray element [%d][%d] = %s",i,j,
pinno[i][j]);
}
}